<template>
  <!-- 队列日志列表 -->
  <section class="page">
    <data-box :data="dataSet" @onPageChange="refreshData" :page="pageService">
      <template slot="columns">
        <el-table-column prop="runTime" label="队列更新时间" :formatter="(row) => $filter.dateTimeFormat(row.runTime)" :min-width="$helper.getColumnWidth(3)" show-overflow-tooltip>
        </el-table-column>
        <el-table-column prop="caseCount" label="总案件数" :min-width="$helper.getColumnWidth(3)" show-overflow-tooltip>
        </el-table-column>
        <el-table-column prop="rejectCount" label="剔除案件数" :min-width="$helper.getColumnWidth(3)" show-overflow-tooltip>
        </el-table-column>
        <el-table-column prop="isDistribute" label="队列是否分配" :formatter="(row) => $filter.dictConvert(row.isDistribute,'State')" :min-width="$helper.getColumnWidth(3)" show-overflow-tooltip>
        </el-table-column>
        <el-table-column prop="runCaseCount" label="运行分配案件数" :min-width="$helper.getColumnWidth(3)" show-overflow-tooltip>
        </el-table-column>
        <el-table-column prop="surpluseCaseCount" label="剩余案件数" :min-width="$helper.getColumnWidth(3)" show-overflow-tooltip>
        </el-table-column>
      </template>
    </data-box>
    <div class="operate-buttons">
      <el-button @click="close">关闭</el-button>
    </div>
  </section>
</template>

<script lang="ts">
import Vue from 'vue';
import Component from 'vue-class-component';
import { Layout, Dependencies } from '~/core/decorator';
import { PageService } from '~/utils/page.service';

import { Prop, Emit } from 'vue-property-decorator';
import { QueueLogService } from "~/services/domain-service/queue-log.service";
@Layout('workspace')
@Component({
  components: {},
})
export default class QueueLog extends Vue {
  @Dependencies(PageService)
  private pageService: PageService;
  @Dependencies(QueueLogService)
  private queueLogService: QueueLogService;
  @Prop() private queueId;
  private dataSet: any[] = [];
  @Emit("close")
  public close() {}
  private mounted() {
    this.refreshData();
  }
  private refreshData() {
    this.queueLogService
      .getAll({queueId:this.queueId}, this.pageService, {})
      .subscribe((data) => {
        this.dataSet = data;
      });
  }
  private reset(){
    this.pageService.reset()
    this.refreshData();
  }

}
</script>

<style lang="less">
</style>
